package com.lm.redblacktree.example;

import com.lm.redblacktree.ele.RedBlackTree;

public class RedBlackTreeExample {
    public static void main(String[] args) {
        RedBlackTree<Integer, String> tree = new RedBlackTree<>();

        // 插入元素
        tree.put(10, "十");
        tree.put(5, "五");
        tree.put(15, "十五");
        tree.put(1, "一");
        tree.put(7, "七");

        // 查询元素
        System.out.println("key=7 -> " + tree.get(7)); // 输出: 七
        System.out.println("key=10 -> " + tree.get(10)); // 输出: 十
        System.out.println("key=20 -> " + tree.get(20)); // 输出: null（不存在）
    }
}
